package com.mh.shiro.controller;

import com.mh.shiro.util.ResultUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: E-mail:
 * @Version: 创建时间：2019年06月21日14:10
 * @Description: 页面跳转类
 */
@Controller
public class RenderController {

    @RequiresAuthentication
    @GetMapping(value = {" ","/index"})
    public ModelAndView home() {
        return ResultUtil.view("index");
    }
    @RequiresPermissions("users")
    @GetMapping("/users")
    public ModelAndView user() {

        return ResultUtil.view("user/list");
    }
    @RequiresPermissions("resources")
    @GetMapping("/resources")
    public ModelAndView resources(Model model) {

        return ResultUtil.view("resources/list");
    }
    @RequiresPermissions("roles")
    @GetMapping("/roles")
    public ModelAndView roles() {
        return ResultUtil.view("role/list");
    }
}
